home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DJLSR106.ARJ / SCREEN2.S < prev    next >
Text File  |  1992-03-29  |  2KB  |  91 lines

  1. /* This is file SCREEN2.S */
  2. /*
  3. ** Copyright (C) 1991 DJ Delorie, 24 Kirsten Ave, Rochester NH 03867-2954
  4. **
  5. ** This file is distributed under the terms listed in the document
  6. ** "copying.dj", available from DJ Delorie at the address above.
  7. ** A copy of "copying.dj" should accompany this file; if not, a copy
  8. ** should be available from where this file was obtained.  This file
  9. ** may not be distributed without a verbatim copy of "copying.dj".
  10. **
  11. ** This file is distributed WITHOUT ANY WARRANTY; without even the implied
  12. ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. **
  14. ** Modified by J. Alan Eldridge, Liberty Brokerage, 77 Water St, NYC 10005
  15. **
  16. ** added global char ScreenAttrib -- this is the attribute
  17. ** used by ScreenClear(): it defaults to 0x07 so as not to
  18. ** break existing code.
  19. **
  20. */
  21.  
  22.     .data
  23.  
  24.     .globl    _ScreenAttrib
  25. _ScreenAttrib:
  26.     .byte 0x07
  27.  
  28. _ScreenPrimary = 0xe01b8000
  29. _ScreenSecondary = 0xe01b0000
  30.     .globl    _ScreenPrimary
  31.     .globl    _ScreenSecondary
  32.  
  33.     .text
  34.  
  35.     .globl    _ScreenSetCursor /* row, col */
  36. _ScreenSetCursor:
  37.     pushl    %ebp
  38.     movl    %esp,%ebp
  39.     pushl    %ebx
  40.     pushl    %esi
  41.     pushl    %edi
  42.     movb    $0x02,%ah
  43.     movb    $0,%bh
  44.     movb    8(%ebp),%dh
  45.     movb    12(%ebp),%dl
  46.     int    $0x10
  47.     popl    %edi
  48.     popl    %esi
  49.     popl    %ebx
  50.     popl    %ebp
  51.     ret
  52.  
  53.     .globl    _ScreenGetCursor /* &row, &col */
  54. _ScreenGetCursor:
  55.     pushl    %ebp
  56.     movl    %esp,%ebp
  57.     pushl    %ebx
  58.     pushl    %esi
  59.     pushl    %edi
  60.     movb    $0x03,%ah
  61.     movb    $0,%bh
  62.     pushl    %ebp
  63.     int    $0x10
  64.     popl    %ebp
  65.     movl    8(%ebp),%esi
  66.     movzbl    %dh,%eax
  67.     movl    %eax,(%esi)
  68.     movl    12(%ebp),%esi
  69.     movzbl    %dl,%eax
  70.     movl    %eax,(%esi)
  71.     popl    %edi
  72.     popl    %esi
  73.     popl    %ebx
  74.     popl    %ebp
  75.     ret
  76.  
  77.     .globl    _ScreenClear
  78. _ScreenClear:
  79.     pushl    %edi
  80.     movl    $0xe0000400,%edi
  81.     movzwl    0xe000044a,%ecx
  82.     movzbl    0xe0000484,%eax
  83.     imull    %eax,%ecx
  84.     movl    $0xe01b8000,%edi
  85.     movb    $0x20,%al
  86.     movb    _ScreenAttrib,%ah
  87.     rep
  88.     stosw
  89.     popl    %edi
  90.     ret
  91.